//
//  ActionViewController.m
//  CareWithFriends
//
//  Created by Versatile Systems, Inc on 11/18/13.
//  Copyright (c) 2013 Muludiang. All rights reserved.
//

#import "ActionViewController.h"
#import "SalesLeadViewController.h"
#import "SubmitIssueViewController.h"
#import "ConnectionsViewController.h"

@interface ActionViewController ()

@end

@implementation ActionViewController

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // return number of rows
    return 3;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    if (indexPath.row == 0){
        [cell.textLabel setText:@"Create An Issue"];
    }else if (indexPath.row == 1){
        [cell.textLabel setText:@"Submit Sales Lead"];
    }else {
        [cell.textLabel setText:@"Connect With A Friend"];
    }
    cell.textLabel.textAlignment = NSTextAlignmentCenter;
    
    
    return cell;
    
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0 ) {
        SubmitIssueViewController *submitIssueView = [self.storyboard instantiateViewControllerWithIdentifier:@"create_issue_view"];
        [self.navigationController pushViewController:submitIssueView animated:YES];
    } else if (indexPath.row ==1 ){
        SalesLeadViewController *salesLeadView = [self.storyboard instantiateViewControllerWithIdentifier:@"sales_lead_view"];
        [self.navigationController pushViewController:salesLeadView animated:YES];        
    }else {
        ConnectionsViewController *connectionsView = [self.storyboard instantiateViewControllerWithIdentifier:@"connect_view"];
        [self.navigationController pushViewController:connectionsView animated:YES];
    }
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
